package com.qiche.util;

import com.qiche.constant.AccountType;
import org.apache.shiro.SecurityUtils;

import com.qiche.model.User;

public class UserUtils {

    public static User getCurrentUser() {
        return (User) SecurityUtils.getSubject().getPrincipal();

    }


    public static boolean checkIsAdmin(User user) {
        return AccountType.ADMIN ==user.getAccountType() ? true : false;
    }

}
